package com.wz.project.api.sap.controller;

import com.wz.framework.web.domain.AjaxResult;
import com.wz.project.api.sap.domain.InputData;
import com.wz.project.api.sap.sapconn.SAPConn;
import com.wz.project.sap.MATERIAL.domain.ZflWmsGetMaterial;
import com.wz.project.util.XmlUtil;
import org.dom4j.DocumentException;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

public class SapTest {

    public static void main(String args[]) throws NoSuchMethodException, IllegalAccessException, InstantiationException, DocumentException, InvocationTargetException, NoSuchFieldException {
        AjaxResult ajaxResult = SAPConn.getTableXml("ZFL_WMS_GET_MATERIAL",
                new InputData("IV_WERKS","2000"),
                new InputData("IV_MATNR", "32900557"),
                new InputData("IV_BEGDATE", "20220321"),
                new InputData("IV_ENDDATE", "20220407"));
        if("0".equals(String.valueOf(ajaxResult.get("code")))){
         List<ZflWmsGetMaterial> list = new ArrayList<ZflWmsGetMaterial>();

//                list = XmlUtil.resolveXmlToObjectList((String) ajaxResult.get("msg"), ZflWmsGetMaterial.class, "ET_TABLE");
                System.out.println(list);
            System.out.println(list.size());

        }



    }
}
